package com.mmall.dao;

import com.mmall.pojo.User;
import org.apache.ibatis.annotations.Param;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int checkUsername(String username);

    int checkEmail(String email);

    User selectLogin(@Param("username") String username,@Param("password") String password);

    String selectQuestionByUsername(String username);
    int checkAnswer(@Param("username") String username,@Param("answer") String answer,
                    @Param("question") String question);
    int update_passwordBy_Username(@Param("passwordNew") String passwordNew,@Param("username")String  username);
    int  checkUserPassword(@Param("passwordOld")String passwordOld,@Param("userId") Integer userId);
    int checkUserEmailById(@Param("email")String email,@Param("userId") Integer userId);

}